import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/core/ext/widget_extension.dart';
import 'package:enterprise_v6_app/app/core/values/colors.dart';
import 'package:enterprise_v6_app/app/modules/application/double_prevention_page/danger_investigation_page/investigation_plan_ledger/investigation_plan_ledger_detail/living_body_recognition_detail/living_rnition_detail_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

///排查计划台账 点击条目上活体识别
class LivingBodyRecognitionDetailPage extends StatelessWidget {
  LivingBodyRecognitionDetailPage({super.key});

  final controller = Get.put(LivingBodyRecognitionDetailController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppColors.bg_color_grey,
      appBar: CustomAppBar(
        titleText: '活体识别',
      ),
      body: Container(
        margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.w),
        child: GridView.builder(
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 2,
            //一行多少个
            // crossAxisCount: 5,
            //滚动方向
            // scrollDirection: Axis.vertical,
            // 左右间隔
            crossAxisSpacing: 11.0,
            // 上下间隔
            mainAxisSpacing: 11.0,
            //宽高比
            childAspectRatio: 166 / 120,
          ),
          itemBuilder: (context, index) {
            return _titleItem(index).clickShowLarge(url: 'https://scpic.chinaz.net/files/pic/pic9/202111/apic36303.jpg', barrierColor: Colors.black);
          },
          itemCount: 0,
        ),
      ),
    );
  }

  ///活体识别图片
  Widget _titleItem(int index) {
    return Stack(
      fit: StackFit.expand,
      children: [
        ClipRRect(
          borderRadius: BorderRadius.circular(8),
          child: Image.network(
            'https://scpic.chinaz'
            '.net/files/pic/pic9/202111/apic36303.jpg',
            fit: BoxFit.cover,
          ),
        ),
        Positioned(
          bottom: 0,
          left: 0,
          right: 0,
          child: Container(
            alignment: Alignment.center,
            height: 26.w,
            decoration: const BoxDecoration(
              color: Color(0x80000000),
              borderRadius: BorderRadius.only(bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8)),
            ),
            child: Text(
              '上传时间：12:00:00',
              style: TextStyle(
                color: Colors.white,
                fontSize: 13.sp,
                fontWeight: FontWeight.w500,
              ),
            ),
          ),
        ),
      ],
    );
  }
}
